{% extends "polls/base.html" %}

{% load i18n %}

{% block title %}{{ title }}{% endblock %}

{% block content %}

{% with "index" as CURRENT_ITEM %}
	{% include "polls/menu.html" %}
{% endwith %}

<div>
<strong>{% blocktrans %}Order Polls By:{% endblocktrans %}</strong>
{% with polls.number as page %}{% with order_by as CURRENT_ITEM %}
	{% locmenu polls-order_by page=page as MENU %}
	{% include "polls/menus/plain.html" %}
{% endwith %}{% endwith %}
</div>

{# List of polls #}{# XX Render a table with more info about the polls #}
{% with polls.object_list as poll_list %}
<div>
{% if poll_list %}
	<h4>{{ title }}</h4>
	<span>({% blocktrans count count as c %}{{ c }} poll found{% plural %}{{ c }} polls found{% endblocktrans %})</span>
    <ul>
    {% for poll in poll_list %}
        <li><a href="{{ poll.get_absolute_url }}">{{ poll }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <h4>{% blocktrans %}No polls found.{% endblocktrans %}</h4>
{% endif %}
</div>
{% endwith %}

{# Pages #}
<div>
    <span>
        {% if polls.has_previous %}
            <a href="?o={{ order_by }}&p={{ polls.previous_page_number }}">previous</a>
        {% endif %}

        <span>
{% blocktrans with polls.number as number and polls.paginator.num_pages as num_pages %}Page {{ number }} of {{ num_pages }}.{% endblocktrans %}
        </span>

        {% if polls.has_next %}
            <a href="?o={{ order_by }}&p={{ polls.next_page_number }}">next</a>
        {% endif %}
    </span>
</div>

{% endblock %}